package com.example.mrzhou.lvmm.presenter.destination;

import com.example.mrzhou.lvmm.entity.destination.Destination;
import com.example.mrzhou.lvmm.model.ModelFactory;
import com.example.mrzhou.lvmm.view.impl.destination.DesView;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Mr.zhou on 2016/10/29.
 */

public class DesPresenter {

    private DesView desView;

    public DesPresenter(DesView desView) {
        this.desView = desView;
    }

    public void getDesData(Map<String, String> map) {
        ModelFactory.getiDesModel().getDesData(map, new Subscriber<Destination>() {
            @Override
            public void onCompleted() {
                desView.onFinsh();
            }

            @Override
            public void onError(Throwable e) {
                desView.onFaiure(e);
            }

            @Override
            public void onNext(Destination destination) {
                desView.onSuccess(destination);
            }
        });

    }
}
